fix: implement more robust retries for Watch#535
Merged
miparnisari merged 1 commit intomainfrom Sep 12, 2025
Merged
Conversation
07c540b to
e3696bb
Compare
481580d to
979db72
Compare
979db72 to
abab714
Compare
tstirrat15
reviewed
Sep 11, 2025
Contributor
tstirrat15
left a comment
There was a problem hiding this comment.
See comments, otherwise LGTM
internal/commands/watch_test.go
Outdated
| }() | ||
| t.Cleanup(s.Stop) | ||
|
|
||
| conn, err := grpc.NewClient("passthrough://bufnet", |
Contributor
Author
There was a problem hiding this comment.
This is establishing a connection to my custom-made Watch server.
I see that other tests do it differently:
// Set up client
ctx := t.Context()
srv := zedtesting.NewTestServer(ctx, t)
go func() {
require.NoError(srv.Run(ctx))
}()
conn, err := srv.GRPCDialContext(ctx)
require.NoError(err)
originalClient := client.NewClient
defer func() {
client.NewClient = originalClient
}()
client.NewClient = zedtesting.ClientFromConn(conn)
c, err := zedtesting.ClientFromConn(conn)(cmd)
require.NoError(err)but in my case i don't want to rely on a real SpiceDB server; I want to have full control on the response given by Watch
Contributor
There was a problem hiding this comment.
Ah yeah in the tests that I was working on I used a fake client and then supplied responses directly through it. Is there a reason to prefer one approach to the other in this case?
a440855 to
69f8f1e
Compare
69f8f1e to
7be8cfd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Similar to authzed/authzed-java#137, I'm modifying the implementation of the
zed relationships watchcommand so thatTesting
Locally against a locally running instance that is behind a Contour/Envoy reverse proxy.
before
with this PR
References